Blood gas parameters are often measured to assess the health a fish (as well as many other creatures). These parameters are known to be affected by many different processes such as stress hormone concentration in the blood. Knowing blood gas values in the blood of a fish can provide a lot of information about that animal and its environment. When collecting blood samples from animals in the field it is not always possible to run the blood tests immediately after they are taken. This is often a problem when sampling fish or other aquatic organisms only accessible by boat. In this case, there is a time delay between collecting the sample, getting from that location to a landing location, and then to a testing facility to finally test the sample. We want to find out if any of these parameters being tested change significantly between time of sample collection and time of sample testing. If there are changes, the accuracy of the blood sample tests may be compromised. Interest in accuracy is also the motivation to test the differences in values when different syringe types (plastic/glass) are used. If there is a difference in any of the parameters between syringe types then this needs to be considered when sampling blood and making sure the same syringe type is used for every sample collected to ensure there is no confounding variable added.
In 2013, ten Cownose rays (R. bonasus) from the shark and ray touch tank at the New England Aquarium were opportunistically selected for blood sampling during their routine spine clipping. Each blood sample was repeatedly analyzed at fixed intervals in order to 1) monitor the changes in blood acid-base parameters as a function of time, and 2) observe the difference in these values between different syringe types. Also in 2013, ten Red-eared sliders (T. elegans) were selected from Rainforest Reptile Shows in Beverly, Massachusetts for blood sampling.
- Do any of these blood gas parameters (lactate, pH, pCO2, or pO2), change significantly over a 90-minute time period after collection?
- Does syringe type (plastic or glass) affect how each value changes over time?
Note: Temperature Corrections
Values for the turtle blood samples were temperature corrected to individual internal temperatures using the following equations. This was done in order to control for differences in the sample temperature from the internal temperature of the animals. The data from the turtle samples uses the temperature of the sample and using the difference in the sample temperature when tested from the original internal temperature reading of the turtle to correct the data so that the values properly reflect the internal temperature of the animal. Temperature corrections for pCO2 and pO2 were validated for Kemp’s Ridley turtles by Keller et al. (2012), while pH corrections were validated for T. elegans, formerly known as Pseudemys scripta elegans at the time of publication by Robin (1962).
CNR blood sample values were temperature corrected to 25°C using the following equations validated for smooth dogfish (Mustelus canis) by Gallagher et al. (2010)
The raw data was formatted as 10 separate tables for each animal (for both rays and turtles), so there was a significant amount of reformatting and data tidying to be done.
The formatting of both the turtle and ray values were pretty much the same except for an added variable of syringe type in the ray data. So the initial steps of coding are fairly similar. The ray and turtle data were both in wide format, however with each animal being considered as a variable it needs to be in long format. This also is necessary to work with ggplot as well as the statistical testing code.
library(readxl)
library(tidyr)
library(dplyr)
library(ggplot2)
library(knitr) #new package
# Load the raw ugly data.
sliders <- read_excel('~/Dropbox/Blood_Gas_Project/Data/BG_data_SLIDERS.xlsx', skip = 0)
# First work with only one chunk(turtle) at a time. Chop off the rest of the data frame.
sliders_1 <-sliders[1:9, 1:8]
kable(sliders_1)
| Turtle | |||||||
|---|---|---|---|---|---|---|---|
| Turtle: 1 | NA | T0 | T1 | T2 | T3 | T4 | T5 |
| Turtle - cartridge: 0:36 | Bbecf | 18 | 19 | 19 | 19 | 16 | 13 |
| Internal Temp: 21.9 C | HCO3 | 39.200000000000003 | 40.4 | 40.299999999999997 | 40.200000000000003 | 38.700000000000003 | 36.5 |
| Weight: 1182 g | TCO2 | 40 | 42 | 42 | 41 | 40 | 38 |
| SCL: 20 cm | SO2 (%) | 98 | 98 | 98 | 99 | 99 | 99 |
| NA | Lac | 3.29 | 3.2 | 3.17 | 3.3 | 3.27 | 3.31 |
| NA | pH | 7.835 | 7.8520000000000003 | 7.8390000000000004 | 7.8570000000000002 | 7.7560000000000002 | 7.7389999999999999 |
| NA | PCO2 | 20.9 | 20.8 | 21.3 | 20.5 | 24.4 | 23.8 |
| NA | PO2 | 32 | 33 | 34 | 38 | 57 | 73 |
# Assign column names (most unnamed).
names(sliders_1) <- c("Turtle", "Value", "T0", "T1", "T2", "T3", "T4", "T5")
# Separate meta data labels and values into two columns for "Meta"(label) and "Data"(value).
sliders_1 <- separate(data = sliders_1, col = "Turtle", into = c("Meta", "Data"), sep = ": ")
# Save the meta data in its own data frame to add back to main data frame after further tidying and remove from table for now.
meta_data_sliders <- data.frame(sliders_1[1:4, 1:2])
sliders_1 <- sliders_1[1:9,3:9]
sliders_1 <- sliders_1[-1,]
# Time to transpose the data from wide to long format to make analysis easier.
sliders_1 <- t(sliders_1)
sliders_1 <- as.data.frame(sliders_1, stringsAsFactors = FALSE)
# Add a time column, remove row names, and fix the column names.
sliders_1$Time <- gsub("Value", "Time", rownames(sliders_1))
rownames(sliders_1) <- NULL
names(sliders_1) <- sliders_1[1,1:9]
sliders_1 <- sliders_1[-1,]
# Transpose and format that meta data we put aside.
meta_data_sliders <- t(meta_data_sliders)
meta_data_sliders <- as.data.frame(meta_data_sliders, stringsAsFactors = FALSE)
# Correct the column names and clear unnecssary row names in meta data.
names(meta_data_sliders) <- meta_data_sliders[1,1:4]
meta_data_sliders <- meta_data_sliders[-1,]
rownames(meta_data_sliders) <- NULL
# Convert turtle, temp, and weight values to numeric.
meta_data_sliders$`Turtle` <- as.numeric(meta_data_sliders$`Turtle`)
meta_data_sliders$`Internal Temp` <- as.numeric(gsub("\\sC", "",
meta_data_sliders$`Internal Temp`))
meta_data_sliders$`Weight` <- as.numeric(gsub("\\sg", "",
meta_data_sliders$`Weight`))
# Put meta data back onto main data frame.
complete_sliders <- data.frame(sliders_1, meta_data_sliders)
| Bbecf | HCO3 | TCO2 | SO2…. | Lac | pH | PCO2 | PO2 | Time | Turtle | Turtle…cartridge | Internal.Temp | Weight | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 18 | 39.2 | 40 | 98 | 3.29 | 7.835 | 20.9 | 32 | T0 | 1 | 0:36 | 21.9 | 1182 |
| 3 | 19 | 40.4 | 42 | 98 | 3.2 | 7.852 | 20.8 | 33 | T1 | 1 | 0:36 | 21.9 | 1182 |
| 4 | 19 | 40.3 | 42 | 98 | 3.17 | 7.839 | 21.3 | 34 | T2 | 1 | 0:36 | 21.9 | 1182 |
| 5 | 19 | 40.2 | 41 | 99 | 3.3 | 7.857 | 20.5 | 38 | T3 | 1 | 0:36 | 21.9 | 1182 |
| 6 | 16 | 38.7 | 40 | 99 | 3.27 | 7.756 | 24.4 | 57 | T4 | 1 | 0:36 | 21.9 | 1182 |
| 7 | 13 | 36.5 | 38 | 99 | 3.31 | 7.739 | 23.8 | 73 | T5 | 1 | 0:36 | 21.9 | 1182 |
# FUNCTION:
read_sliders_transform <- function(turtle_number){
#file name
filename <- paste0('~/Dropbox/Blood_Gas_Project/Data/BG_data_SLIDERS.xlsx')
#read in per turtle
sliders <- read_excel(filename, skip = turtle_number*10-10)
#only one turtle at a time
sliders_1 <-sliders[1:9, 1:8]
#rename columns
names(sliders_1) <- c("Turtle", "Value", "T0", "T1", "T2", "T3", "T4", "T5")
#separate meta data into two columns
sliders_1 <- separate(data = sliders_1, col = "Turtle", into = c("Meta", "Data"), sep = ": ")
#save meta data as a new data frame
meta_data_sliders <- data.frame(sliders_1[1:4, 1:2])
#get rid of extra rows and columns
sliders_1 <- sliders_1[2:9,3:9]
#transpose
sliders_1 <- t(sliders_1)
#get rid of factors
sliders_1 <- as.data.frame(sliders_1, stringsAsFactors = FALSE)
#add time column and rename value
sliders_1$Time <- gsub("Value", "Time", rownames(sliders_1))
#rename columns
names(sliders_1) <- sliders_1[1,1:9]
# remove first row
sliders_1 <- sliders_1[-1,]
# TRANSPOSE AND FORMAT META DATA
meta_data_sliders <- t(meta_data_sliders)
meta_data_sliders <- as.data.frame(meta_data_sliders, stringsAsFactors = FALSE)
# correct column names
names(meta_data_sliders) <- meta_data_sliders[1,1:4]
meta_data_sliders <- meta_data_sliders[-1,]
#clear row names
rownames(meta_data_sliders) <- NULL
# Make variables numeric and remove extra characters
meta_data_sliders$`Turtle` <- as.numeric(meta_data_sliders$`Turtle`)
meta_data_sliders$`Internal Temp` <- as.numeric(gsub("\\sC", "", meta_data_sliders$`Internal Temp`))
meta_data_sliders$`Weight` <- as.numeric(gsub("\\sg", "", meta_data_sliders$`Weight`))
#add meta data back to data frame
complete_sliders2 <- data.frame(sliders_1, meta_data_sliders)
#rbind to compelte data frame
complete_sliders <- rbind(complete_sliders, complete_sliders2)
return(complete_sliders)
}
# Run above function for turtles 2 through 10 to create compelte new data frame.
for(i in 2:10){
complete_sliders <- read_sliders_transform(i)
}
# The variables pH, pCO2, and pO2 need to be numeric for necessary temperature corrections.
complete_sliders$pH <- as.numeric(complete_sliders$pH)
complete_sliders$PCO2 <- as.numeric(complete_sliders$PCO2)
complete_sliders$PO2 <- as.numeric(complete_sliders$PO2)
# Temperature corrections according to validated equations cited in the introduction.
complete_sliders$temp_change <- (37 - complete_sliders$Internal.Temp)
complete_sliders$pH <- ((0.0144*complete_sliders$temp_change) + complete_sliders$pH)
complete_sliders$PCO2 <- (complete_sliders$PCO2*(10^-0.019*complete_sliders$temp_change))
complete_sliders$PO2 <- (complete_sliders$PO2*(10^-0.0058*complete_sliders$temp_change))
# Filter NAs in pH
#(no values for turtle 3 at T4, removes whole row of NAs)
complete_sliders <- complete_sliders %>%
filter(!is.na(pH))
# Convert time to numeric values (in minutes) because the T0-T5 integers are not constant.
complete_sliders$Time <- gsub("T0", 0, complete_sliders$Time)
complete_sliders$Time <- gsub("T1", 5, complete_sliders$Time)
complete_sliders$Time <- gsub("T2", 10, complete_sliders$Time)
complete_sliders$Time <- gsub("T3", 15, complete_sliders$Time)
complete_sliders$Time <- gsub("T4", 45, complete_sliders$Time)
complete_sliders$Time <- gsub("T5", 90, complete_sliders$Time)
# Make time numeric.
complete_sliders$Time <- as.numeric(complete_sliders$Time)
# Newly tidy data was saved as a csv file
write.csv(tidy_sliders, file = 'tidy_turtle_data.csv')
# Load that ridiculous data!
rays <- read_excel('~/Dropbox/Blood_Gas_Project/Data/BG_data_RAYS.xlsx', skip = 0)
# As before, work with only one ray to start.
rays_1 <- rays[1:10,1:14]
kable(rays_1)
| Ray | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Pit_Num: 7813 | NA | T0 | NA | T1 | NA | T2 | NA | T3 | NA | T4 | NA | T5 | NA |
| CNR - cartridge: 1:38 | Syringe Type | P | G | P | G | P | G | P | G | P | G | P | G |
| Weight: 9.65 kg | Bbecf | -24 | -24 | -24 | -24 | -23 | -24 | -23 | -24 | -24 | -24 | -24 | -24 |
| Wingspan: 78 cm | HCO3 | 5.8 | 5.7 | 5.8 | 5.7 | 5.9 | 5.8 | 5.9 | 5.6 | 5.7 | 5.6 | 5.8 | 5.9 |
| NA | TCO2 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 |
| NA | SO2 (%) | 8 | NA | 10 | 7 | 9 | 8 | 8 | 12 | 10 | 20 | 12 | 21 |
| NA | Lac | 1.1499999999999999 | 1.1599999999999999 | 1.18 | 1.1000000000000001 | 1.1100000000000001 | 1.1299999999999999 | 1.1200000000000001 | 1.1599999999999999 | 1.1100000000000001 | 1.1299999999999999 | 1.1599999999999999 | 1.19 |
| NA | pH | 7.274 | 7.27 | 7.2789999999999999 | 7.27 | 7.2779999999999996 | 7.2640000000000002 | 7.28 | 7.2690000000000001 | 7.2610000000000001 | 7.2610000000000001 | 7.2619999999999996 | 7.2510000000000003 |
| NA | PCO2 | 10.5 | 10.3 | 10.4 | 10.4 | 10.6 | 10.7 | 10.5 | 10.3 | 10.7 | 10.4 | 10.8 | 11.1 |
| NA | PO2 | <5 | NA | 6 | <5 | 5 | <5 | <5 | 6 | 6 | 8 | 6 | 8 |
# Separate meta data and labels (all columns must be named first).
# The label "Time" will make sense after transposing data.
names(rays_1) <- c("Ray", "Time", "T0", "T0", "T1", "T1", "T2", "T2", "T3", "T3", "T4", "T4", "T5", "T5")
rays_1 <- separate(data = rays_1, col = "Ray", into = c("Meta", "Data"), sep = ": ")
# Save meta data in its own data frame for later.
meta_data_rays <- data.frame(rays_1[1:4,1:2])
# Take meta data out of main data frame.
rays_1 <- rays_1[1:10,3:15]
# Put col names in first row so they become a new column after transposing instead of just row names.
rays_1[1,] <- names(rays_1)
# Transpose from wide to long.
rays_1 <- t(rays_1)
rays_1 <- as.data.frame(rays_1, stringsAsFactors = FALSE)
# Use row 1 to rename columns and clear row names.
names(rays_1) <-rays_1[1,]
rays_1 <- rays_1[-1,]
row.names(rays_1) <- NULL
# Transpose meta data.
meta_data_rays <- t(meta_data_rays)
meta_data_rays <- as.data.frame(meta_data_rays, stringsAsFactors = FALSE)
# Correct column names and clear row name in meta data.
names(meta_data_rays) <- meta_data_rays[1,1:4]
meta_data_rays <- meta_data_rays[-1,]
row.names(meta_data_rays) <- NULL
# Pit number(each ray's unique ID number), weight and wingspan in meta data should be converted to numeric.
meta_data_rays$Pit_Num <- as.numeric(meta_data_rays$Pit_Num)
meta_data_rays$Weight <- as.numeric(gsub("\\skg", "", meta_data_rays$Weight))
meta_data_rays$Wingspan <- as.numeric(gsub("\\scm", "", meta_data_rays$Wingspan))
# Put meta data back in main data frame.
complete_rays <- data.frame(rays_1, meta_data_rays)
After data tidying:
| Time | Syringe.Type | Bbecf | HCO3 | TCO2 | SO2…. | Lac | pH | PCO2 | PO2 | Pit_Num | CNR…cartridge | Weight | Wingspan |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T0 | P | -24 | 5.8 | 6 | 8 | 1.15 | 7.274 | 10.5 | <5 | 7813 | 1:38 | 9.65 | 78 |
| T0 | G | -24 | 5.7 | 6 | NA | 1.16 | 7.270 | 10.3 | NA | 7813 | 1:38 | 9.65 | 78 |
| T1 | P | -24 | 5.8 | 6 | 10 | 1.18 | 7.279 | 10.4 | 6 | 7813 | 1:38 | 9.65 | 78 |
| T1 | G | -24 | 5.7 | 6 | 7 | 1.10 | 7.270 | 10.4 | <5 | 7813 | 1:38 | 9.65 | 78 |
| T2 | P | -23 | 5.9 | 6 | 9 | 1.11 | 7.278 | 10.6 | 5 | 7813 | 1:38 | 9.65 | 78 |
| T2 | G | -24 | 5.8 | 6 | 8 | 1.13 | 7.264 | 10.7 | <5 | 7813 | 1:38 | 9.65 | 78 |
| T3 | P | -23 | 5.9 | 6 | 8 | 1.12 | 7.280 | 10.5 | <5 | 7813 | 1:38 | 9.65 | 78 |
| T3 | G | -24 | 5.6 | 6 | 12 | 1.16 | 7.269 | 10.3 | 6 | 7813 | 1:38 | 9.65 | 78 |
| T4 | P | -24 | 5.7 | 6 | 10 | 1.11 | 7.261 | 10.7 | 6 | 7813 | 1:38 | 9.65 | 78 |
| T4 | G | -24 | 5.6 | 6 | 20 | 1.13 | 7.261 | 10.4 | 8 | 7813 | 1:38 | 9.65 | 78 |
| T5 | P | -24 | 5.8 | 6 | 12 | 1.16 | 7.262 | 10.8 | 6 | 7813 | 1:38 | 9.65 | 78 |
| T5 | G | -24 | 5.9 | 6 | 21 | 1.19 | 7.251 | 11.1 | 8 | 7813 | 1:38 | 9.65 | 78 |
read_rays_transform <- function(ray_number){
#file name
filename <- paste0('~/Dropbox/Blood_Gas_Project/Data/BG_data_RAYS.xlsx')
#read in each ray
rays <- read_excel(filename, skip = ray_number*11-11)
#one ray at a time
rays_1 <- rays[1:10,1:14]
#separate meta data and labels (all columns must be named first)
names(rays_1) <- c("Ray", "Time", "T0", "T0", "T1", "T1", "T2", "T2", "T3", "T3", "T4", "T4", "T5", "T5")
rays_1 <- separate(data = rays_1, col = "Ray", into = c("Meta", "Data"), sep = ": ")
#save meta data in its own data frame
meta_data_rays <- data.frame(rays_1[1:4,1:2])
#take meta data out of main data frame
rays_1 <- rays_1[1:10,3:15]
#put col names in first row so they become a new column after transposing instead of just row names
rays_1[1,] <- names(rays_1)
#transpose
rays_1 <- t(rays_1)
rays_1 <- as.data.frame(rays_1, stringsAsFactors = FALSE)
#use row 1 to rename columns and clear row names
names(rays_1) <-rays_1[1,]
rays_1 <- rays_1[-1,]
row.names(rays_1) <- NULL
#transpose meta data
meta_data_rays <- t(meta_data_rays)
meta_data_rays <- as.data.frame(meta_data_rays, stringsAsFactors = FALSE)
# correct column names, clear row name in meta data
names(meta_data_rays) <- meta_data_rays[1,1:4]
meta_data_rays <- meta_data_rays[-1,]
row.names(meta_data_rays) <- NULL
# pit number, weight and wingspan in meta data as numeric
meta_data_rays$Pit_Num <- as.numeric(meta_data_rays$Pit_Num)
meta_data_rays$Weight <- as.numeric(gsub("\\skg", "", meta_data_rays$Weight))
meta_data_rays$Wingspan <- as.numeric(gsub("\\scm", "", meta_data_rays$Wingspan))
#put meta data back in main data frame
complete_rays2 <- data.frame(rays_1, meta_data_rays)
#add to complete data frame
complete_rays <- rbind(complete_rays, complete_rays2)
return(complete_rays)
}
# Run above function for rays 2 through 10 to rbind all rays together.
for(i in 2:10){
complete_rays <- read_rays_transform(i)
}
# Cut out non-focal variables.
complete_rays <- complete_rays[,-c(3:6)]
# Filter out rows with NAs for all 4 variables (Lac, PO2, PCO2, and pH).
complete_rays <- complete_rays[!with(complete_rays,is.na(Lac)& is.na(PO2)& is.na(PCO2)& is.na(pH)),]
# Convert time to numeric values (in minutes) again, for accurate data since they are not constant times apart.
complete_rays$Time <- gsub("T0", 0, complete_rays$Time)
complete_rays$Time <- gsub("T1", 5, complete_rays$Time)
complete_rays$Time <- gsub("T2", 10, complete_rays$Time)
complete_rays$Time <- gsub("T3", 15, complete_rays$Time)
complete_rays$Time <- gsub("T4", 45, complete_rays$Time)
complete_rays$Time <- gsub("T5", 90, complete_rays$Time)
# Must convert pH, pCO2, and PO2 to numeric for temperature corrections.
complete_rays$pH <- as.numeric(complete_rays$pH)
complete_rays$PCO2 <- as.numeric(complete_rays$PCO2)
complete_rays$PO2 <- as.numeric(complete_rays$PO2)
complete_rays$Lac <- as.numeric(complete_rays$Lac)
# Temperature corrections (equations cited in introduction).
complete_rays$pH <- (0.795*complete_rays$pH) + 1.797
complete_rays$PCO2 <- (0.173*complete_rays$PCO2) + 0.775
complete_rays$PO2 <- (0.572*complete_rays$PO2) - 1.449
# Save data frame as a clean csv file.
write.csv(complete_rays, file = 'tidy_ray_data.csv')
To answer the first question, (if any of the variables change over time), each of the four variables (Lac, pH, pCO2, pO2) were plotted against time and linear regression was used to test if there is significant change over time for each variable. The null hypothesis was that the slope is zero and there is no significant change over time. The alternative hypothesis was that the slope was different than zero, and there was a change in that variable over time. Where blood gas values changed significantly over time, regression lines were included.
As for the second question, (does syringe type affect how each value changes over time), will be answered by testing each variable with paired data (where the same ray at the same time point has data for both syringes) with an anova test.The null hypothesis is that the slopes of the two syringe types is the same, and there is no affect on how the value changes over time. The alternative hypothesis is that the slopes of the different syringe types are different, and therefore does affect how the value changes over time.
##
## Call:
## lm(formula = Lac ~ Time, data = sliders_lac)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.4506 -0.5635 -0.1343 0.3273 2.2058
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.104251 0.173971 12.095 <2e-16 ***
## Time -0.001573 0.004170 -0.377 0.708
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.9611 on 51 degrees of freedom
## Multiple R-squared: 0.002783, Adjusted R-squared: -0.01677
## F-statistic: 0.1423 on 1 and 51 DF, p-value: 0.7075
The very high p-value (0.708), means we fail to reject the null hypothesis that there is no differece in lactate values over time. The qqplot shows some skew at the tails, this data may not be perfectly linear, however for our purposes it is acceptable.
##
## Call:
## lm(formula = log(Lac) ~ Time, data = sliders_lac)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.13647 -0.20419 0.04981 0.27190 0.83271
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.6282249 0.0931374 6.745 1.38e-08 ***
## Time -0.0007953 0.0022324 -0.356 0.723
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5146 on 51 degrees of freedom
## Multiple R-squared: 0.002482, Adjusted R-squared: -0.01708
## F-statistic: 0.1269 on 1 and 51 DF, p-value: 0.7231
##
## Call:
## lm(formula = pH ~ Time, data = sliders)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.09987 -0.03674 -0.01220 0.01886 0.13113
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.9580463 0.0102598 775.652 < 2e-16 ***
## Time -0.0007045 0.0002459 -2.865 0.00583 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.05976 on 57 degrees of freedom
## Multiple R-squared: 0.1259, Adjusted R-squared: 0.1105
## F-statistic: 8.208 on 1 and 57 DF, p-value: 0.005829
This qq plot shows the same skewed pattern at the end of the line that was seen with lac variable and the regression vs fitted also shows a pattern at the end of the line. However the regression test showed a very low p value (0.00583).We can reject the null hypothess that there is no difference in pH over time in favor of the alternative hypothesis that pH does change significantly over time.
##
## Call:
## lm(formula = PCO2 ~ Time, data = sliders)
##
## Residuals:
## Min 1Q Median 3Q Max
## -64.88 -30.31 -13.60 14.79 127.64
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 323.4326 8.0364 40.25 <2e-16 ***
## Time 0.2119 0.1926 1.10 0.276
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 46.81 on 57 degrees of freedom
## Multiple R-squared: 0.0208, Adjusted R-squared: 0.003625
## F-statistic: 1.211 on 1 and 57 DF, p-value: 0.2758
The p-value is high at 0.2703, so this test suggests we cannot reject the null that there is no significant change over time. Assumptions again show some skew in the qqplot.
##
## Call:
## lm(formula = log(PO2) ~ Time, data = sliders)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.64363 -0.17722 -0.02069 0.20140 0.75867
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.88065 0.05466 107.581 < 2e-16 ***
## Time 0.00801 0.00131 6.114 9.34e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3184 on 57 degrees of freedom
## Multiple R-squared: 0.3961, Adjusted R-squared: 0.3855
## F-statistic: 37.38 on 1 and 57 DF, p-value: 9.341e-08
The low p-value of 9.4e-08 is defnitely low enough to reject the null hypothess that there is no difference in pO2 over time in favor of the alternative hypothesis that pO2 does change significantly over time. The two assumptions are met that this data set fits the linear model and the residuals vs fitted plot looks fairly straight.
##
## Call:
## lm(formula = Lac ~ Time, data = rays)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.65672 -0.32598 0.08911 0.30469 0.62164
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.0183646 0.0550464 18.50 <2e-16 ***
## Time -0.0003294 0.0013193 -0.25 0.803
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3825 on 82 degrees of freedom
## (17 observations deleted due to missingness)
## Multiple R-squared: 0.0007595, Adjusted R-squared: -0.01143
## F-statistic: 0.06233 on 1 and 82 DF, p-value: 0.8035
Very high p-value, we fail to reject the null hypothesis that there is no change in lactate over time. The qqplot shows a slightly “s” shaped pattern at the tails.
##
## Call:
## lm(formula = pH ~ Time, data = rays)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.071665 -0.029597 0.007768 0.027720 0.051406
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.5823104 0.0043443 1745.331 < 2e-16 ***
## Time -0.0003161 0.0001089 -2.903 0.00457 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.03324 on 97 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.07994, Adjusted R-squared: 0.07045
## F-statistic: 8.428 on 1 and 97 DF, p-value: 0.004575
A low p-value, (0.00457), allows us to reject the null hypothess that there is no difference in pH over time in favor of the alternative hypothesis that pH does change significantly over time. The qq plot shows similar “s” shaped pattern.
##
## Call:
## lm(formula = PCO2 ~ Time, data = rays)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.41873 -0.11469 -0.02819 0.10146 0.42659
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.4936126 0.0253441 98.390 <2e-16 ***
## Time 0.0009946 0.0006352 1.566 0.121
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1939 on 97 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.02466, Adjusted R-squared: 0.0146
## F-statistic: 2.452 on 1 and 97 DF, p-value: 0.1206
High p-value,(0.121), we fail to reject the null hypothesis that there is no change in pCO2 over time. The qqplot shows a slightly “s” shaped pattern at the tails.
##
## Call:
## lm(formula = PO2 ~ Time, data = rays)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.2781 -1.7869 0.3142 1.3064 8.5091
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.316314 0.315039 4.178 6.79e-05 ***
## Time 0.033618 0.007818 4.300 4.32e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.289 on 90 degrees of freedom
## (9 observations deleted due to missingness)
## Multiple R-squared: 0.1704, Adjusted R-squared: 0.1612
## F-statistic: 18.49 on 1 and 90 DF, p-value: 4.319e-05
A very low p-value, (4.32 e^-05), allows us to reject the null hypothess that there is no difference in pO2 over time in favor of the alternative hypothesis that pO2 does change significantly over time. The qq plot is skewed at the tails.
## Anova Table (Type II tests)
##
## Response: Lac
## Sum Sq Df F value Pr(>F)
## Time 0.0095 1 0.0636 0.8015
## Syringe 0.0197 1 0.1318 0.7175
## Time:Syringe 0.0025 1 0.0166 0.8978
## Residuals 11.9771 80
A very high p-value, (0.8978), means we fail to reject the null hypothesis that syringe type has no effect on how the lactate changes over time.
## Anova Table (Type II tests)
##
## Response: pH
## Sum Sq Df F value Pr(>F)
## Time 0.009507 1 8.5815 0.004252 **
## Syringe 0.001840 1 1.6610 0.200603
## Time:Syringe 0.000110 1 0.0992 0.753432
## Residuals 0.105242 95
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Very high p-value, (0.753432), means we fail to reject the null hypothesis that syringe type has no effect on how the pH changes over time.
## Anova Table (Type II tests)
##
## Response: PCO2
## Sum Sq Df F value Pr(>F)
## Time 0.0929 1 2.4203 0.1231
## Syringe 0.0024 1 0.0630 0.8024
## Time:Syringe 0.0001 1 0.0015 0.9689
## Residuals 3.6456 95
Very high p-value, (0.9689), means we fail to reject the null hypothesis that syringe type has no effect on how the pCO2 changes over time.
## Anova Table (Type II tests)
##
## Response: PO2
## Sum Sq Df F value Pr(>F)
## Time 97.93 1 19.1359 3.332e-05 ***
## Syringe 21.14 1 4.1304 0.04513 *
## Time:Syringe 0.16 1 0.0313 0.86003
## Residuals 450.34 88
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Very high p-value, (0.86003), means we fail to reject the null hypothesis that syringe type has no effect on how the pO2 changes over time.
We found that for the turtles, as well as the rays, pH and pO2 changed significantly over time. Therefore, lac and pCO2 did not change significantly over time for both animals. It seems that syringe type does not impose any change in how any of the variables change over time. There were some concerns on how well the assumptions were met for each test, however for these simpler tests it seemed to fit well enough to accept.
The information gained from this is that when collecting blood samples, (at least from these two groups of animals), pH and pO2 are time sensitive values and this must be considered when testing. It seems that lac and pCO2 for these animals may not change significantly over a 90-minute period after collection. We cannot assume anything about these values past the 90-minute timeframe. More testing is definitely necessary along with larger sample sizes, especially because of the variability seen between each animal even within each species.
One particular place that further visualizations/analyses seem to be needed is the last test of the syringe interactions that tests pO2. The graph looks like there should be a difference between the types of syringes for pO2, but the test indicates otherwise.
The lines representing the means and standard deviations of each syringe type do not overlap. This seems to indiate a significant difference between groups. There could be too much error due to small sample size for this to be of any real concern.
Plenty of further investigation is necessary.